package com.iyue.portal;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.iyue.framework.BaseAction;
import com.iyue.portal.helper.PortalUtil;

/**
 * 《通知》实现类
 * 
 * @author 孙晓晔
 * @version $Id: Error.java,v 1.1 2010/10/14 17:07:17 fresh Exp $
 */
public class Error extends PortalUtil {

	public Error() {

	}

	/**
	 * 404
	 * 
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @param action
	 * @return
	 * @throws Exception
	 */
	public ActionForward e404(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response,
			BaseAction action) throws Exception {

		request.setAttribute("msg", "抱歉，该网页不存在！");

		return action.display(request, response, "info");
	}

	/**
	 * 500
	 * 
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @param action
	 * @return
	 * @throws Exception
	 */
	public ActionForward e500(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response,
			BaseAction action) throws Exception {

		request.setAttribute("msg", "抱歉，服务器忙！");

		return action.display(request, response, "info");
	}

}
